/**
 * Created with Vim7.3 Mac
 * @fileOverview : 
 * @author : Lyle lylechen2014@gmail.com
 * @since : 2016-08-29 11:35:31
 * @filename : src/components/userProfileAbout.js
 * @version : 
 * @description : 
 */

import React, { Component } from 'react';
import {
    StyleSheet,
    Text,
    View,
    Image,
    TouchableOpacity,
    ScrollView
} from 'react-native';

let { width, height } = Utils.size;
let userObj;

class UserProfileAbout extends Component {

    constructor(props) {
        super(props);
        userObj = this.props.userInfo;
        this.state = {};
    }

    render() {
        return (
          <View style={styles.userProfileAbout}>
                 <View style={styles.rowProfile}>
                   <View style={styles.profileTitle}> 
                       <Text>{Lang.userProfileAbout_aboutMe}</Text>
                   </View>
                   <View>  
                       <Text style={styles.profileValue}>{this.getAboutMe()}</Text>
                   </View>
                </View>

                 <View style={styles.rowProfile}>
                   <View style={styles.profileTitle}>   
                       <Text>{Lang.userProfileAbout_liveWith}</Text>
                   </View>
                   <View>  
                       <Text style={styles.profileValue}>{this.getLiveWith()}</Text>
                   </View>
                </View>

                <View style={styles.rowProfile}>
                   <View style={styles.profileTitle}>   
                       <Text>{Lang.userProfileAbout_mfdi}</Text>
                   </View>
                   <View>  
                       <Text style={styles.profileValue}>{this.getMyFirstDateIdea()}</Text>
                   </View>
                </View>

                 <View style={styles.rowProfile}>
                   <View style={styles.profileTitle}>   
                       <Text>{Lang.userProfileAbout_RelationshipStatus}</Text>
                   </View>
                   <View>  
                       <Text style={styles.profileValue}>{this.getRelationshipStatus()}</Text>
                   </View>
                </View>

                <View style={styles.rowProfile}>
                   <View style={styles.profileTitle}>   
                       <Text>{Lang.userProfileAbout_lookFor}</Text>
                   </View>
                   <View>  
                       <Text style={styles.profileValue}>{this.getLookFor()}</Text>
                   </View>
                </View>
            </View>
        );
    }

    getAboutMe() {
        return Share.filterValue(userObj.about.about_me);
    }

    getAboutMyMatch() {
        return Share.filterValue(userObj.about.about_my_match);
    }

    getLiveWith() { 
        return Share.showCheckboxLabel('local_disability',userObj.about.disability);
    }

    getMyFirstDateIdea() {
        return userObj.about.firstidea ? userObj.about.firstidea : Lang.userProfileAbout_defaultFirstIdeaText;
    }

    getRelationshipStatus() {
        return Share.showCheckboxLabel('local_marital',userObj.about.relationship_status);
    }

    getLookFor() {
        return Share.showCheckboxLabel('local_relation',userObj.about.looking_for);
    }

}

const styles = StyleSheet.create({

    userProfileAbout:{
      flex:1,
      width:width,
      backgroundColor:'#fff',
      paddingTop:10,
    },

    rowProfile: {
        marginLeft:15,
        marginRight:15,
        marginTop:10,
        marginBottom:10,
    },

    profileTitle: {

    },

    profileValue: {
        marginTop:10,
        color:'#666',
        fontSize:12,
    },

});

export default UserProfileAbout;

